﻿// Decompiled with JetBrains decompiler
// Type: Netick.ConsoleLogger
// Assembly: Netick, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 6726ECA1-C773-4CF7-8952-E81B30D93B52
// Assembly location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Runtime\Netick.dll
// XML documentation location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Runtime\Netick.xml

using System;

#nullable disable
namespace Netick;

public class ConsoleLogger : INetickLogger
{
  public void LogError(object message)
  {
    ConsoleLogger.Log((object) ("ERROR: " + message?.ToString()), ConsoleColor.Red);
  }

  public void LogWarning(object message)
  {
    ConsoleLogger.Log((object) ("WARNING: " + message?.ToString()), ConsoleColor.Yellow);
  }

  public void Log(object message)
  {
    ConsoleLogger.Log((object) ("INFO: " + message?.ToString()), ConsoleColor.Gray);
  }

  public void LogException(object message, object targetScript)
  {
    ConsoleLogger.Log((object) ("ERROR: " + message?.ToString()), ConsoleColor.Red);
  }

  private static void Log(object message, ConsoleColor color)
  {
    Console.ForegroundColor = color;
    Console.WriteLine(message);
    Console.ForegroundColor = Console.ForegroundColor;
  }
}
